package com.example.javabasic.thread.classtwo.singleton.demo4;
//监听者
public interface LifeStyleListener {
    Object lock = new Object();
    //通知接口
    default void onEvent(RunnableEvent event) {
        synchronized (lock){
            System.out.println(event.getThread().getName()+"状态改变了"+event.getState());
            if(event.getCause()!=null){
                System.out.println(event.getThread().getName()+"出现异常!"+event.getState());
                event.getCause().printStackTrace();
            }
        }
    }
}
